package com.wyz.web;

import com.wyz.dao.StudentDao;
import com.wyz.entity.UserInfo;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet("/updateUser1")
public class UpdateUserServlet1 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html;charset=utf-8");
        PrintWriter pw = resp.getWriter();
        String id = req.getParameter("id");
        StudentDao sd = new StudentDao();
        UserInfo userInfo = sd.queryUserById(id);
        req.setAttribute("s",userInfo);
        req.getRequestDispatcher("updateUser.jsp").forward(req,resp);
    }
}
